package day0318.math;

import java.util.Random;

/**
 * @Author Stringzhua
 * @Date 2024/3/19 9:39
 * description:Math.random底层调用Random的nextDouble
 */
public class Math_01 {
    public static void main(String[] args) {
//        Math math = new Math();
        System.out.println(Math.PI);
        System.out.println(Math.abs(-100));
        System.out.println(Math.pow(3, 2));
        System.out.println(Math.sqrt(4));
        System.out.println(Math.max(3, 4.0));
        System.out.println(Math.min(3, 4.0));
        System.out.println(Math.random());
        System.out.println("====");
        System.out.println((int) (Math.random() * 80 + 20));//0~90
        Random random = new Random();
        //0~90
        System.out.println(random.nextInt(90));
        System.out.println("====");
        //弧度=角度*(pi/180)
        //角度=弧度/(pi/180)
        System.out.println(Math.sin(90*(Math.PI/180)));
        System.out.println(Math.cos(0 * (Math.PI / 180)));
        System.out.println(Math.tan(45 * (Math.PI / 180)));

        //实现方法的重载
        long a = Math.round(3.25);
        int b = Math.round(3.25f);
        System.out.println(a);
        System.out.println(b);
    }
}
